import { ProtocolComponent, UseComponent } from "@components/Apps/Lidar/LidarComponent";
import { ClientMessage } from "@runtime/generate/message/ClientMessage";
import DeviceComponent from "@runtime/module/Device/DeviceComponent";
import MessageHandler from "@runtime/module/Handler/MessageHandler";

/**
 * 设备更新消息处理器
 */
export default class LaserRadarUpdateMessageHandler extends MessageHandler<ClientMessage.LaserRadarProtocolUpdateMessage> {            
    protected async RunAsync(message: ClientMessage.LaserRadarProtocolUpdateMessage): Promise<void> {        
        if(ProtocolComponent.Default.DataSource.value == 'Device') {
            ProtocolComponent.Default.Datas.push(message.Data)
        } else {
            return
        }
    }
}
